const { PrismaClient } = require('@prisma/client');
const prisma = new PrismaClient();

async function createWarehouse() {
  try {
    const warehouse = await prisma.warehouse.create({
      data: {
        name: '默认仓库',
        location: '公司总部',
        managerId: 1,
        status: true,
        contact: '123456789',
        remarks: '主要仓库'
      }
    });
    console.log('仓库创建成功:', warehouse);
  } catch (error) {
    console.error('创建仓库失败:', error);
  } finally {
    await prisma.$disconnect();
  }
}

createWarehouse(); 